all.spec.js ➔ ???   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 1
c 2
b 0
f 0
nc 1
dl 0
loc 1
rs 10
nop 3
1
'use strict'
2
3
import { describe, it } from 'mocha'
4
import { expect } from 'chai'
5
import restify from 'restify'
6
import endpoints from '.'
7
8
const server = restify.createServer()
9
server.get('/hello/:name', (req, res, next) => next())
10
11
/* eslint-disable no-undef */
12
describe('endpoints: helpers', () => {
13
  context('.all', () => {
14
    it('Should throw exception if server is not provided', () => {
15
      try {
16
        endpoints.listAll()
17
      } catch (error) {
18
        expect(error.code).to.be.equal('ERR_ASSERTION')
19
      }
20
    })
21
    it('Should not return empty', () => {
22
      const output = endpoints.listAll(server)
23
      expect(output).to.be.not.undefined()
24
      expect(output).to.be.not.null()
25
    })
26
  })
27
})
28